package com.lin.mqdemo.activemq.subscriber;

import lombok.extern.slf4j.Slf4j;
import org.springframework.jms.annotation.JmsListener;
import org.springframework.stereotype.Component;

/**
 * 订阅者
 *
 * @author lin
 * @date 2018年8月29日
 */
@Component
@Slf4j
public class Subscriber {

    @JmsListener(destination = "${test.mq-topic.demo1}" , containerFactory = "myJmsContainerFactory")
    public void receiveTopic1(String message) {
        System.out.println("监听topic1=============监听topic");
        log.info("监听topic1=============监听topic"+message);
        System.out.println(message);
    }
    @JmsListener(destination = "${test.mq-topic.demo2}" , containerFactory = "myJmsContainerFactory")
    public void receiveTopic2(String message) {
        System.out.println("监听topic2=============监听topic");
        System.out.println(message);
    }

    @JmsListener(destination = "${test.mq-topic.demo3}" , containerFactory = "myJmsContainerFactory")
    public void receiveTopic3(String message) {
        System.out.println("监听topic3=============监听topic");
        System.out.println(message);
    }
}
